import {Component, OnInit} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {MyService} from "../my.service";
import {SettingUrl} from "../../../public/setting/setting_url";

@Component({
  selector: 'app-my-group-detail',
  templateUrl: './my-group-detail.component.html',
  styleUrls: ['./my-group-detail.component.css']
})
export class MyGroupDetailComponent implements OnInit {
  private code: string;
  public myGroupInfo: any = {};//myGroup信息

  constructor(private myService: MyService, private route: ActivatedRoute, private router: Router) {
  }

  ngOnInit() {
    this.code = this.route.snapshot.params.code;//获取参数
    this.loadMyGroupInfo();//查询myGroup类型列表
  }

  /**
   * 查询myGroup信息
   */
  loadMyGroupInfo() {
    this.myService.loadMyGroupByCode(this.code).then((data: any) => {
      if (data) this.myGroupInfo = data;
    })
  }

}
